Seal GtkSelectionData
authorTim Janik <timj@src.gnome.org>
Fri, 20 Jun 2008 11:09:36 +0000 (11:09 +0000)
committerTim Janik <timj@src.gnome.org>
Fri, 20 Jun 2008 11:09:36 +0000 (11:09 +0000)
svn path=/trunk/; revision=20619

gtk/gtk.symbols
gtk/gtkselection.c
gtk/gtkselection.h

index 60b69a9f0679a645d5788db7e0eed64834ba78f3..2ac45f436384a7a0ace7bc684d890805bcbc1765 100644 (file)
@@ -3332,11 +3332,21 @@ gtk_selection_clear_targets
 gtk_selection_convert
 gtk_selection_data_copy
 gtk_selection_data_free
+gtk_selection_data_get_target
+gtk_selection_data_get_data_type
+gtk_selection_data_get_format
+gtk_selection_data_get_data
+gtk_selection_data_get_length
 gtk_selection_data_get_pixbuf
 gtk_selection_data_get_targets
 gtk_selection_data_get_text
 gtk_selection_data_get_type G_GNUC_CONST
 gtk_selection_data_get_uris
+gtk_selection_data_set_target
+gtk_selection_data_set_data_type
+gtk_selection_data_set_format
+gtk_selection_data_set_data
+gtk_selection_data_set_length
 gtk_selection_data_set
 gtk_selection_data_set_pixbuf
 gtk_selection_data_set_text
index 234839801c7659429514c4d3efd5c744ea16fa44..65350e84f36604f6005e6831c8aeb3fc4464d5a8 100644 (file)
@@ -1109,6 +1109,166 @@ gtk_selection_convert (GtkWidget *widget,
   return TRUE;
 }
 
+/**
+ * gtk_selection_data_set_target:
+ * @selection_data: a pointer to a #GtkSelectionData structure.
+ * @target: target of the selection
+ *
+ * Sets the target of the selection.
+ *
+ * Since: GSEAL-branch
+ **/
+void gtk_selection_data_set_target (GtkSelectionData     *selection_data,
+                                   GdkAtom              target)
+{
+  g_return_if_fail (selection_data != NULL);
+
+  selection_data->target = target;
+}
+
+/**
+ * gtk_selection_data_get_target:
+ * @selection_data: a pointer to a #GtkSelectionData structure.
+ *
+ * Retrieves the target of the selection.
+ *
+ * Since: GSEAL-branch
+ **/
+GdkAtom gtk_selection_data_get_target (GtkSelectionData     *selection_data)
+{
+  g_return_val_if_fail (selection_data != NULL, 0);
+
+  return selection_data->target;
+}
+
+/**
+ * gtk_selection_data_set_data_type:
+ * @selection_data: a pointer to a #GtkSelectionData structure.
+ * @data_type: data type of the selection
+ *
+ * Sets the data type of the selection.
+ *
+ * Since: GSEAL-branch
+ **/
+void gtk_selection_data_set_data_type (GtkSelectionData     *selection_data,
+                                      GdkAtom              data_type)
+{
+  g_return_if_fail (selection_data != NULL);
+
+  selection_data->type = data_type;
+}
+
+/**
+ * gtk_selection_data_get_data_type:
+ * @selection_data: a pointer to a #GtkSelectionData structure.
+ *
+ * Retrieves the data type of the selection.
+ *
+ * Since: GSEAL-branch
+ **/
+GdkAtom gtk_selection_data_get_data_type (GtkSelectionData     *selection_data)
+{
+  g_return_val_if_fail (selection_data != NULL, 0);
+
+  return selection_data->type;
+}
+
+/**
+ * gtk_selection_data_set_format:
+ * @selection_data: a pointer to a #GtkSelectionData structure.
+ * @format: format of the selection
+ *
+ * Sets the format of the selection.
+ *
+ * Since: GSEAL-branch
+ **/
+void gtk_selection_data_set_format (GtkSelectionData     *selection_data,
+                                   gint                 format)
+{
+  g_return_if_fail (selection_data != NULL);
+
+  selection_data->format = format;
+}
+
+/**
+ * gtk_selection_data_get_format:
+ * @selection_data: a pointer to a #GtkSelectionData structure.
+ *
+ * Retrieves the format of the selection.
+ *
+ * Since: GSEAL-branch
+ **/
+gint gtk_selection_data_get_format (GtkSelectionData     *selection_data)
+{
+  g_return_val_if_fail (selection_data != NULL, 0);
+
+  return selection_data->format;
+}
+
+/**
+ * gtk_selection_data_set_data:
+ * @selection_data: a pointer to a #GtkSelectionData structure.
+ * @data: data of the selection
+ *
+ * Sets the raw data of the selection.
+ *
+ * Since: GSEAL-branch
+ **/
+void gtk_selection_data_set_data (GtkSelectionData     *selection_data,
+                                 const guchar         *data)
+{
+  g_return_if_fail (selection_data != NULL);
+
+  g_free (selection_data->data);
+  selection_data->data = (guchar*) g_strdup (data);
+}
+
+/**
+ * gtk_selection_data_get_data:
+ * @selection_data: a pointer to a #GtkSelectionData structure.
+ *
+ * Retrieves the raw data of the selection.
+ *
+ * Since: GSEAL-branch
+ **/
+const guchar* gtk_selection_data_get_data (GtkSelectionData     *selection_data)
+{
+  g_return_val_if_fail (selection_data != NULL, NULL);
+
+  return selection_data->data;
+}
+
+/**
+ * gtk_selection_data_set_target:
+ * @selection_data: a pointer to a #GtkSelectionData structure.
+ * @length: length of the selection
+ *
+ * Sets the length of the selection.
+ *
+ * Since: GSEAL-branch
+ **/
+void gtk_selection_data_set_length (GtkSelectionData     *selection_data,
+                                   gint                 length)
+{
+  g_return_if_fail (selection_data != NULL);
+
+  selection_data->length = length;
+}
+
+/**
+ * gtk_selection_data_get_length:
+ * @selection_data: a pointer to a #GtkSelectionData structure.
+ *
+ * Retrieves the length of the selection.
+ *
+ * Since: GSEAL-branch
+ **/
+gint gtk_selection_data_get_length (GtkSelectionData     *selection_data)
+{
+  g_return_val_if_fail (selection_data != NULL, 0);
+
+  return selection_data->length;
+}
 
 /**
  * gtk_selection_data_set:
index 7db71ecbb44828155c74d81266b64a338d062b04..fdc5c6344bc6079e363954333703d78c55682adf 100644 (file)
@@ -58,13 +58,13 @@ typedef struct _GtkTargetEntry   GtkTargetEntry;
 
 struct _GtkSelectionData
 {
-  GdkAtom      selection;
-  GdkAtom      target;
-  GdkAtom      type;
-  gint         format;
-  guchar       *data;
-  gint         length;
-  GdkDisplay   *display;
+  GdkAtom      GSEAL (selection);
+  GdkAtom      GSEAL (target);
+  GdkAtom      GSEAL (type);
+  gint         GSEAL (format);
+  guchar       *GSEAL (data);
+  gint         GSEAL (length);
+  GdkDisplay   *GSEAL (display);
 };
 
 struct _GtkTargetEntry {
@@ -148,6 +148,22 @@ gboolean gtk_selection_convert       (GtkWidget            *widget,
                                      GdkAtom               selection,
                                      GdkAtom               target,
                                      guint32               time_);
+void gtk_selection_data_set_target (GtkSelectionData     *selection_data,
+                                   GdkAtom              target);
+GdkAtom gtk_selection_data_get_target (GtkSelectionData  *selection_data);
+void gtk_selection_data_set_data_type (GtkSelectionData     *selection_data,
+                                      GdkAtom              target);
+GdkAtom gtk_selection_data_get_data_type (GtkSelectionData  *selection_data);
+void gtk_selection_data_set_format (GtkSelectionData     *selection_data,
+                                   gint                  format);
+gint gtk_selection_data_get_format (GtkSelectionData  *selection_data);
+void gtk_selection_data_set_data (GtkSelectionData     *selection_data,
+                                 const guchar         *data);
+const guchar *gtk_selection_data_get_data (GtkSelectionData  *selection_data);
+void gtk_selection_data_set_length (GtkSelectionData     *selection_data,
+                                   gint                  length);
+gint gtk_selection_data_get_length (GtkSelectionData  *selection_data);
+GdkDisplay gtk_selection_data_get_display (GtkSelectionData  *selection_data);
 void     gtk_selection_data_set      (GtkSelectionData     *selection_data,
                                      GdkAtom               type,
                                      gint                  format,